<template>
	<view class="talent-list-item">
		<view @tap="onPressToNavigateDetail(item)">
			<view class="pah-30 talent-item-info flex rcb">
				<view class="talent-name-info flex rcs">
					<!-- 名字 -->
					<view class="talent-name">{{item.name || item.nickname}}</view>
					<!-- 人才等级 -->
					<TalentLevel v-if='item.level_num > 0' :level="item.level_num" />
				</view>
				<!-- 状态 -->
				<TalentWorkStatus :status="item.status_str" />
			</view>
			<view class="pah-30 talent-detail-info flex rcb">
				<view class="detail-left-con">
					<view class="talent-profile-info">
						<!-- 性别 -->
						<text class="detail-item">{{item.sex_str}}</text>
						<!-- 年纪 -->
						<text class="detail-item">{{item.age}}</text>
						<!-- 城市 -->
						<text class="detail-item">{{item.city}}</text>
						<text class="detail-item">|</text>
						<!-- 电话 -->
						<text class="detail-item detail-item-cur">{{item.phone}}</text>
					</view>
					<!-- 岗位名称 -->
					<TalentSkills v-if="item.position_work_name_str!=null" :skills="[item.position_work_name_str]" />
					<view class="flex source">
						<view class="source-title">来源:</view>
						<view class="source-detail" v-if="item.channel_name!=null">{{item.channel_name}}</view>
					</view>
				</view>
				<view class="detail-right-con pic-wrap btn-wrap flex ccc">
					<text class="cuIcon-right f-999"></text>
				</view>
			</view>
			<view class="line-style horizontal-line"></view>
		</view>
		<!-- 底部内容区 -->
		<view class="pah-30 bottom-content flex rcb">
			<view class="bottom-left-con belong-person">
				<text>所属人员：</text>
				<text>{{item.distribution_user || item.create_name || ''}}</text>
			</view>
			<view class="btn-wrap flex rce" v-if="tabnum == 0 && item.status != 3">
				<view class="btn-item flex rce" @tap="handleClickRecommend(item)">
					<image class="btn-icon" src="/static/icon/icon_user_plane.png" mode="widthFix" />
					<text class="btn-title">推荐岗位</text>
				</view>
				<!-- <view class="line-style vertical-line"></view> -->
				<view class="btn-item flex rce" @tap="disabled(item, 'DialogModal1')">
					<image class="btn-icon" src="/static/icon/icon_close_red.png" mode="widthFix" />
					<text class="btn-title">不可用</text>
				</view>
				<!-- <view class="line-style vertical-line"></view> -->
				<view class="btn-item flex rce" @tap="handleClickAllot">
					<image class="btn-icon" src="/static/icon/fenpei.png" mode="widthFix" />
					<text class="btn-title">分配</text>
				</view>
			</view>
			<!-- 候选人 -->
			<view class="btn-wrap flex rce" v-else-if="tabnum == 1">
				<view class="btn-item flex rce" @tap="showModal(item, 'DialogModal1')">
					<image class="btn-icon" src="/static/icon/icon_close_red.png" mode="widthFix" />
					<text class="btn-title">取消候选</text>
				</view>
				<!-- <view class="line-style vertical-line"></view> -->
				<view class="btn-item flex rce" @tap="enter(item, 'DialogModal1')">
					<image class="btn-icon" src="/static/icon/icon_success.png" mode="widthFix" />
					<text class="btn-title">进入面试</text>
				</view>
			</view>
			<!-- 面试中 -->
			<view class="btn-wrap flex rce" v-else-if="tabnum == 2">
				<view class="btn-item flex rce" @tap="FailInterview(item, 'DialogModal1')">
					<image class="btn-icon" src="/static/icon/icon_close_red.png" mode="widthFix" />
					<text class="btn-title">面试不通过</text>
				</view>
				<!-- <view class="line-style vertical-line"></view> -->
				<view class="btn-item flex rce" @tap="enterHealth(item, 'DialogModal1')">
					<image class="btn-icon" src="/static/icon/icon_success.png" mode="widthFix" />
					<text class="btn-title">进入体检</text>
				</view>
			</view>
			<!-- 体检中 -->
			<view class="btn-wrap flex rce" v-else-if="tabnum == 3">
				<view class="btn-item flex rce" @tap="unsuccessPhysical(item, 'DialogModal1')">
					<image class="btn-icon" src="/static/icon/icon_close_red.png" mode="widthFix" />
					<text class="btn-title">体检不成功</text>
				</view>
				<!-- <view class="line-style vertical-line"></view> -->
				<view class="btn-item flex rce" @tap="successPhysical(item, 'DialogModal1')">
					<image class="btn-icon" src="/static/icon/icon_success.png" mode="widthFix" />
					<text class="btn-title">进入待入职</text>
				</view>
			</view>
			<!-- 待入职 -->
			<view class="btn-wrap flex rce" v-else-if="tabnum == 4">
				<view class="btn-item flex rce" @tap="giveupEntry(item, 'DialogModal1')">
					<image class="btn-icon" src="/static/icon/icon_close_red.png" mode="widthFix" />
					<text class="btn-title">放弃入职</text>
				</view>
				<view class="btn-item flex rce" @tap="affirmEntry(item)">
					<image class="btn-icon" src="/static/icon/icon_success.png" mode="widthFix" />
					<text class="btn-title">确认入职</text>
				</view>
			</view>
			<!-- 在职 -->
			<view class="btn-wrap flex rce" v-else-if="tabnum == 5 || (item.status == 3 && tabnum == 0)">
				<view class="btn-item flex rce" @tap="manageLeave(item, 'DialogModal1')">
					<image class="btn-icon" src="/static/icon/icon_user_exit.png" mode="widthFix" />
					<text class="btn-title">办理离职</text>
				</view>
				<!-- <view class="line-style vertical-line"></view> -->
				<view class="btn-item flex rce" @tap="changePost(item, 'DialogModal1')">
					<image class="btn-icon" src="/static/icon/icon_exchange.png" mode="widthFix" />
					<text class="btn-title">更换岗位</text>
				</view>
			</view>
			<!-- 离职 -->
			<view class="btn-wrap flex rce" v-else-if="tabnum == 6">
				<view class="btn-item flex rce recommend-btn-item" @tap="handleClickRecommend(item)">
					<image class="btn-icon" src="/static/icon/icon_user_plane.png" mode="widthFix" />
					<text class="one-title">推荐岗位</text>
				</view>
			</view>
			<!-- 未合作 -->
			<view class="btn-wrap flex rce" v-else-if="tabnum == 7">
				<view class="btn-item flex rce" @tap="handleClickRecommend(item)">
					<image class="btn-icon" src="/static/icon/icon_user_plane.png" mode="widthFix" />
					<text class="btn-title">推荐岗位</text>
				</view>
				<!-- <view class="line-style vertical-line"></view> -->
				<view class="btn-item flex rce" @tap="disabled(item, 'DialogModal1')">
					<image class="btn-icon" src="/static/icon/icon_close_red.png" mode="widthFix" />
					<text class="btn-title">不可用</text>
				</view>
			</view>
			<!-- 恢复可用 -->
			<view class="btn-wrap flex rce" v-else-if="tabnum == 8">
				<view class="btn-item flex rce recommend-btn-item" @tap="recoverUse(item,'DialogModal1')">
					<image class="btn-icon" src="/static/icon/icon_success.png" mode="widthFix" />
					<text class="one-title">恢复可用</text>
				</view>
			</view>
		</view>

		<!-- 取消候选模态框 -->
		<view class="cu-modal" :class="modalName=='DialogModal1'?'show':''">
			<!-- 取消候选 -->
			<view class="cu-dialog set-width" v-if="DialogModal1">
				<view class="cu-bar justify-end changebgc flex rcb">
					<view class="text-white top-title">取消候选 - {{item.name}}</view>
					<view class="action" @tap="hideModal">
						<text class="cuIcon-close text-white"></text>
					</view>
				</view>
				<view class="cu-form-group set-height">
					<view class="text-area-view">
						<textarea class="set-textarea" v-model="remark1" placeholder="请输入原因"></textarea>
					</view>
				</view>
				<view class="cu-bar bg-white set-bottom">
					<view class="flex">
						<view class="set-btn1" @tap="hideModal">取消</view>
						<view class="cu-btn set-btn2" @tap="handleClickFilterCancel">确定</view>
					</view>
				</view>
			</view>
			<!-- 进入面试模态框 -->
			<view class="cu-dialog set-width" v-if="DialogModal">
				<view class="cu-bar justify-end changebgc flex rcb">
					<view class="text-white top-title">进入面试 - {{item.name}}</view>
					<view class="action" @tap="hideModal">
						<text class="cuIcon-close text-white"></text>
					</view>
				</view>
				<view class="cu-form-group set-height">
					确定进入面试吗？
				</view>
				<view class="cu-bar bg-white set-bottom">
					<view class="flex">
						<view class="set-btn1" @tap="hideModal">取消</view>
						<view class="cu-btn set-btn2" @tap="handleClickEnter">确定</view>
					</view>
				</view>
			</view>
			<!-- 面试不通过模态框 -->
			<view class="cu-dialog set-width" v-if="DialogModal2">
				<view class="cu-bar justify-end changebgc flex rcb">
					<view class="text-white top-title">面试不通过 - {{item.name}}</view>
					<view class="action" @tap="hideModal">
						<text class="cuIcon-close text-white"></text>
					</view>
				</view>
				<view class="cu-form-group set-height">
					<view class="text-area-view">
						<textarea class="set-textarea" v-model="remark2" placeholder="请输入原因"></textarea>
					</view>
				</view>
				<view class="cu-bar bg-white set-bottom">
					<view class="flex">
						<view class="set-btn1" @tap="hideModal">取消</view>
						<view class="cu-btn set-btn2" @tap="handleClickFailInterview">确定</view>
					</view>
				</view>
			</view>
			<!-- 进入体检模态框 -->
			<view class="cu-dialog set-width" v-if="DialogModal3">
				<view class="cu-bar justify-end changebgc flex rcb">
					<view class="text-white top-title">进入体检 - {{item.name}}</view>
					<view class="action" @tap="hideModal">
						<text class="cuIcon-close text-white"></text>
					</view>
				</view>
				<view class="cu-form-group set-height">
					<view class="text-area-view">
						<textarea class="set-textarea" v-model="remark3" placeholder="请输入原因"></textarea>
					</view>
				</view>
				<view class="cu-bar bg-white set-bottom">
					<view class="flex">
						<view class="set-btn1" @tap="hideModal">取消</view>
						<view class="cu-btn set-btn2" @tap="handleClickEnterHealth">确定</view>
					</view>
				</view>
			</view>
			<!-- 体检不通过模态框 -->
			<view class="cu-dialog set-width" v-if="DialogModal4">
				<view class="cu-bar justify-end changebgc flex rcb">
					<view class="text-white top-title">体检不通过 - {{item.name}}</view>
					<view class="action" @tap="hideModal">
						<text class="cuIcon-close text-white"></text>
					</view>
				</view>
				<view class="cu-form-group set-height">
					<view class="text-area-view">
						<textarea class="set-textarea" v-model="remark4" placeholder="请输入原因"></textarea>
					</view>
				</view>
				<view class="cu-bar bg-white set-bottom">
					<view class="flex">
						<view class="set-btn1" @tap="hideModal">取消</view>
						<view class="cu-btn set-btn2" @tap="handleClickUnsuccessPhysical">确定</view>
					</view>
				</view>
			</view>
			<!-- 体检通过模态框 -->
			<view class="cu-dialog set-width" v-if="DialogModal5">
				<view class="cu-bar justify-end changebgc flex rcb">
					<view class="text-white top-title">体检通过 - {{item.name}}</view>
					<view class="action" @tap="hideModal">
						<text class="cuIcon-close text-white"></text>
					</view>
				</view>
				<view class="cu-form-group set-height">
					<view class="text-area-view">
						<textarea class="set-textarea" v-model="remark5" placeholder="请输入原因"></textarea>
					</view>
				</view>
				<view class="cu-bar bg-white set-bottom">
					<view class="flex">
						<view class="set-btn1" @tap="hideModal">取消</view>
						<view class="cu-btn set-btn2" @tap="handleClickSuccessPhysical">确定</view>
					</view>
				</view>
			</view>
			<!-- 放弃入职模态框 -->
			<view class="cu-dialog set-width" v-if="DialogModal6">
				<view class="cu-bar justify-end changebgc flex rcb">
					<view class="text-white top-title">放弃入职 - {{item.name}}</view>
					<view class="action" @tap="hideModal">
						<text class="cuIcon-close text-white"></text>
					</view>
				</view>
				<view class="set-height bg-fff">
					<view class="flex-mine">
						<view class="detail-h2">确定该人才未入职吗？确认未入职后，该人才信息将进入简历库。</view>
					</view>
				</view>
				<view class="cu-bar bg-white set-bottom">
					<view class="flex">
						<view class="set-btn1" @tap="hideModal">取消</view>
						<view class="cu-btn set-btn2" @tap="handleClickGiveupEntry">确定</view>
					</view>
				</view>
			</view>
			<!-- 离职模态框 -->
			<view class="cu-dialog set-width" v-if="DialogModal7">
				<view class="cu-bar justify-end changebgc flex rcb">
					<view class="text-white top-title">离职 - {{item.name}}</view>
					<view class="action" @tap="hideModal">
						<text class="cuIcon-close text-white"></text>
					</view>
				</view>
				<view class="set-height bg-fff">
					<!-- <view class="flex flex-mine">
						<view class="title-h2">姓名:</view>
						<view class="detail-h2">{{item.name}}</view>
					</view> -->
					<view class="cu-form-group">
						<view class="title">离职时间</view>
						<picker mode="date" :value="date || 0" start="2015-09-01" end="2020-09-01" @change="DateChange">
							<view class="picker">
								{{date || '请选择'}}
							</view>
						</picker>
					</view>
					<view class="cu-form-group">
						<view class="title">离职类型</view>
						<picker @change="PickerChange" :value="index_leave_reason" :range="leave_reason" range-key="name">
							<view class="picker">
								{{index_leave_reason>0?leave_reason[index_leave_reason].name : '请选择'}}
							</view>
						</picker>
					</view>
					<view class="cu-form-group">
						<view class="title">薪资结算日</view>
						<picker mode="date" :value="date1 || 0" start="2015-09-01" end="2020-09-01" @change="DateChange1">
							<view class="picker">
								{{date1 || '请选择'}}
							</view>
						</picker>
					</view>
					<view class="cu-form-group set-height">
						<view class="text-area-view">
							<textarea class="set-textarea" maxlength="0" v-model="remark6" placeholder="离职原因"></textarea>
						</view>
					</view>
				</view>
				<view class="cu-bar bg-white set-bottom">
					<view class="flex">
						<view class="set-btn1" @tap="hideModal">取消</view>
						<view class="cu-btn set-btn2" @tap="handleClickManageLeave">确定</view>
					</view>
				</view>
			</view>
			<!-- 更换岗位模态框 -->
			<!-- <changePost :item="item" :modalName = "modalName" ></changePost> -->
			<view class="cu-dialog set-width" v-if="DialogModal8">
				<view class="cu-bar justify-end changebgc flex rcb">
					<view class="text-white top-title">更换岗位 - {{item.name}}</view>
					<view class="action" @tap="hideModal">
						<text class="cuIcon-close text-white"></text>
					</view>
				</view>
				<view class="set-height bg-fff">
					<!-- <view class="flex flex-mine">
						<view class="title-h2">姓名:</view>
						<view class="detail-h2">{{item.name}}</view>
					</view> -->
					<view class="flex-mine">
						<view class="form-item cu-form-group">
							<view class="title">岗位</view>
							<picker @change="positionListChange" :value="index_position" :range="position_list" range-key="name">
								<view class="picker">
									{{index_position>0?position_list[index_position].name:'请选择'}}
								</view>
							</picker>
						</view>
					</view>
				</view>
				<view class="cu-bar bg-white set-bottom">
					<view class="flex">
						<view class="set-btn1" @tap="hideModal">取消</view>
						<view class="cu-btn set-btn2" @tap="handleClickChangePost">确定</view>
					</view>
				</view>
			</view>
			<!-- 恢复可用模态框 -->
			<view class="cu-dialog set-width" v-if="DialogModal9">
				<view class="cu-bar justify-end changebgc flex rcb">
					<view class="text-white top-title">恢复可用 - {{item.name}}</view>
					<view class="action" @tap="hideModal">
						<text class="cuIcon-close text-white"></text>
					</view>
				</view>
				<view class="set-height bg-fff">
					<!-- <view class="flex flex-mine">
						<view class="title-h2">姓名:</view>
						<view class="detail-h2">{{item.name}}</view>
					</view> -->
					<view class="flex-mine">
						<view class="detail-h2">确定恢复当前人才的可用状态吗？</view>
					</view>
				</view>
				<view class="cu-bar bg-white set-bottom">
					<view class="flex">
						<view class="set-btn1" @tap="hideModal">取消</view>
						<view class="cu-btn set-btn2" @tap="handleClickRecoverUse">确定</view>
					</view>
				</view>
			</view>
			<!-- 不可用模态框 -->
			<view class="cu-dialog set-width" v-if="DialogModal10">
				<view class="cu-bar justify-end changebgc flex rcb">
					<view class="text-white top-title">不可用 - {{item.name}}</view>
					<view class="action" @tap="hideModal">
						<text class="cuIcon-close text-white"></text>
					</view>
				</view>
				<view class="set-height bg-fff">
					<!-- <view class="flex flex-mine">
						<view class="title-h2">姓名:</view>
						<view class="detail-h2">{{item.name}}</view>
					</view> -->
					<view class="flex-mine">
						<view class="detail-h2">确定将当前人才置为不可用吗？</view>
					</view>
				</view>
				<view class="cu-bar bg-white set-bottom">
					<view class="flex">
						<view class="set-btn1" @tap="hideModal">取消</view>
						<view class="cu-btn set-btn2" @tap="handleClickDisabled">确定</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script scoped>
	import TalentLevel from '../common/talent-level.vue'
	import TalentWorkStatus from '../common/talent-work-status.vue'
	import TalentSkills from '../common/talent-skills.vue'
	import TalentModal from '../modal/talent-item-modal.vue'
	// import changePost from '../../pages/model/changePost'
	export default {
		components: {
			TalentLevel,
			TalentWorkStatus,
			TalentSkills,
			TalentModal
			// // changePost
		},
		props: {
			getFilterList: {
				type: Function,
				default: null
			},
			onRefresh: Function,
			item: Object,
			index: Number,
			tabnum: {
				default: 0
			},
		},
		data() {
			return {
				canSubmit: true,
				DialogModal1: false, //取消候选
				DialogModal: false, //进入面试
				DialogModal2: false, //面试不通过
				DialogModal3: false, //进入体检
				DialogModal4: false, //体检不成功
				DialogModal5: false, //进入待入职
				DialogModal6: false, //放弃入职
				DialogModal7: false, //办理离职
				DialogModal8: false, //更换岗位
				DialogModal9: false, //恢复可用
				DialogModal10: false, //不可用



				position_id: '', //调换岗位
				position_list: [],
				index_position: 0,
				picker1: [],
				index1: 0,
				leaveMsg: '', //离职错误提示
				index_leave_reason: 0,
				// item:[],
				remark1: '', //取消候选的备注
				remark2: '', //面试不通过备注
				remark3: '', //进入体检备注
				remark4: '', //体检不通过
				remark5: '', //体检通过
				remark6: '', //离职
				leaveCase: '', //传给后台的离职类型
				Images: this.Images,
				modalName: null,
				modalName1: null,
				date: '', //日期选择
				date1: '', //薪资结算日
				leave_reason: [], //离职类型
				token: '',
			}
		},
		methods: {
			// 点击推荐岗位
			handleClickRecommend(item) {
				// console.log(item)
				uni.navigateTo({
					url: '/pages/talent_pool/recommendPost?item=' + JSON.stringify(item)
				})
			},
			// 点击分配传参数跳转页面
			handleClickAllot() {
				uni.navigateTo({
					url: '/pages/work_bench/distributionList?item=' + JSON.stringify(this.item)
				});
			},
			// 岗位类型
			PickerChange1(e) {
				uni.hideKeyboard();
				this.index1 = e.detail.value
				this.position_id = this.picker1[this.index1].position_type_id
			},
			// 岗位类型
			positionListChange(e) {
				uni.hideKeyboard();
				this.index_position = e.detail.value
				this.position_id = this.position_list[this.index_position].id;
			},
			// 离职类型
			PickerChange(e) {
				uni.hideKeyboard();
				this.index_leave_reason = e.detail.value
				this.leaveCase = this.leave_reason[this.index_leave_reason].id;
				// console.log("离职类型",this.picker[this.index])
			},
			// 日期选择
			DateChange(e) {
				this.date = e.detail.value
			},
			// 薪资结算日
			DateChange1(e) {
				this.date1 = e.detail.value
			},
			// 取token
			getToken() {
				try {
					const value = uni.getStorageSync('login_key');
					if (value) {
						this.token = value;
					}
				} catch (e) {
					// error
				}
			},
			// 请求岗位参数
			async getPost() {
				// 发请求
				let url = this.ServicesApi.selectWhereList;
				let data = {
					id: this.item.id,
					company_id: this.item.company_id,
				};
				let result = await this.Services.post(url, data);
				if (result.code == this.StatusCode.SUCCESS_CODE) {
					this.picker1 = result.data.position_type;
					this.position_list = result.data.position_list;
					this.leave_reason = result.data.leave_reason;
				}
			},
			// 取消候选
			showModal(item, name, model) {
				this.modalName = name
				this.DialogModal1 = true; // 取消候选
				this.DialogModal = false; //进入面试
				this.DialogModal2 = false; //面试不通过
				this.DialogModal3 = false; //进入体检
				this.DialogModal4 = false; //体检不成功
				this.DialogModal5 = false; //进入待入职
				this.DialogModal6 = false; //放弃入职
				this.DialogModal7 = false; //办理离职
				this.DialogModal8 = false; //更换岗位
				this.DialogModal9 = false; //恢复可用
				this.DialogModal10 = false; //不可用
				this.item = item;
				// console.log(this.modalName)
				// console.log(this.id)
			},
			async handleClickFilterCancel() {
				// 发请求
				let url = this.ServicesApi.filterCancel;
				let data = {
					plog_id: this.item.plog_id,
					remark: this.remark1,
				};
				if (!this.canSubmit) return;
				this.canSubmit = false;
				let result = await this.Services.post(url, data);
				this.canSubmit = true;
				if (result.code == this.StatusCode.SUCCESS_CODE) {
					this.modalName = null
					// this.$parent.getcountTopList();
					this.onRefresh && this.onRefresh();
					uni.showToast({
						icon: 'none',
				        title: result.msg
					});
				}
			},
			// 进入面试
			enter(item, name) {
				this.modalName = name
				this.DialogModal = true;
				this.DialogModal1 = false; // 取消候选
				this.DialogModal2 = false; //面试不通过
				this.DialogModal3 = false; //进入体检
				this.DialogModal4 = false; //体检不成功
				this.DialogModal5 = false; //进入待入职
				this.DialogModal6 = false; //放弃入职
				this.DialogModal7 = false; //办理离职
				this.DialogModal8 = false; //更换岗位
				this.DialogModal9 = false; //恢复可用
				this.DialogModal10 = false; //不可用
				this.item = item
			},
			async handleClickEnter() {
				// 发请求
				let url = this.ServicesApi.filterThrough;
				let data = {
					personnel_id: this.item.id,
					company_id: this.item.company_id,
					position_id: this.item.position_id,
					station_id: '', //驻企人员id,从驻企那边传过来的参数
				};
				if (!this.canSubmit) return;
				this.canSubmit = false;
				let result = await this.Services.post(url, data);
				this.canSubmit = true;
				if (result.code == this.StatusCode.SUCCESS_CODE) {
					this.modalName = null
					// this.$parent.getcountTopList();
					this.onRefresh && this.onRefresh();
					uni.showToast({
						icon: 'none',
				        title: result.msg
					});
				}
			},
			// 面试不通过
			FailInterview(item, name) {
				this.modalName = name
				this.DialogModal2 = true;
				this.DialogModal = false;
				this.DialogModal1 = false; // 取消候选
				this.DialogModal3 = false; //进入体检
				this.DialogModal4 = false; //体检不成功
				this.DialogModal5 = false; //进入待入职
				this.DialogModal6 = false; //放弃入职
				this.DialogModal7 = false; //办理离职
				this.DialogModal8 = false; //更换岗位
				this.DialogModal9 = false; //恢复可用
				this.DialogModal10 = false; //不可用
				this.item = item
			},
			async handleClickFailInterview() {
				// 发请求
				let url = this.ServicesApi.auditionPass;
				let data = {
					aud_id: this.item.aud_id,
					remark: this.remark2,
				};
				if (!this.canSubmit) return;
				this.canSubmit = false;
				let result = await this.Services.post(url, data);
				this.canSubmit = true;
				if (result.code == this.StatusCode.SUCCESS_CODE) {
					this.modalName = null
					// this.$parent.getcountTopList();
					this.onRefresh && this.onRefresh();
					uni.showToast({
						icon: 'none',
				        title: result.msg
					});
				}
			},
			// 进入体检
			enterHealth(item, name) {
				this.modalName = name
				this.DialogModal3 = true;
				this.DialogModal = false;
				this.DialogModal1 = false; // 取消候选
				this.DialogModal2 = false; //面试不通过
				this.DialogModal4 = false; //体检不成功
				this.DialogModal5 = false; //进入待入职
				this.DialogModal6 = false; //放弃入职
				this.DialogModal7 = false; //办理离职
				this.DialogModal8 = false; //更换岗位
				this.DialogModal9 = false; //恢复可用
				this.DialogModal10 = false; //不可用
				this.item = item
			},
			async handleClickEnterHealth() {
				// 发请求
				let url = this.ServicesApi.auditionThrough;
				let data = {
					aud_id: this.item.aud_id,
					remark: this.remark3,
				};
				if (!this.canSubmit) return;
				this.canSubmit = false;
				let result = await this.Services.post(url, data);
				this.canSubmit = true;
				if (result.code == this.StatusCode.SUCCESS_CODE) {
					this.modalName = null
					// this.$parent.getcountTopList();
					this.onRefresh && this.onRefresh();
					uni.showToast({
						icon: 'none',
				        title: result.msg
					});
				}
			},
			// 体检不通过
			unsuccessPhysical(item, name) {
				this.modalName = name
				this.DialogModal4 = true;
				this.DialogModal = false;
				this.DialogModal1 = false; // 取消候选
				this.DialogModal2 = false; //面试不通过
				this.DialogModal3 = false; //进入体检
				this.DialogModal5 = false; //进入待入职
				this.DialogModal6 = false; //放弃入职
				this.DialogModal7 = false; //办理离职
				this.DialogModal8 = false; //更换岗位
				this.DialogModal9 = false; //恢复可用
				this.DialogModal10 = false; //不可用
				this.item = item
			},
			async handleClickUnsuccessPhysical() {
				// 发请求
				let url = this.ServicesApi.pePass;
				let data = {
					pe_id: this.item.pe_id,
					remark: this.remark4
				};
				if (!this.canSubmit) return;
				this.canSubmit = false;
				let result = await this.Services.post(url, data);
				this.canSubmit = true;
				if (result.code == this.StatusCode.SUCCESS_CODE) {
					this.modalName = null
					// this.$parent.getcountTopList();
					this.onRefresh && this.onRefresh();
					uni.showToast({
						icon: 'none',
				        title: result.msg
					});
				}
			},
			// 体检通过
			successPhysical(item, name) {
				this.modalName = name
				this.DialogModal = false;
				this.DialogModal1 = false; // 取消候选
				this.DialogModal2 = false; //面试不通过
				this.DialogModal3 = false; //进入体检
				this.DialogModal4 = false; //体检不成功
				this.DialogModal5 = true; //进入待入职
				this.DialogModal6 = false; //放弃入职
				this.DialogModal7 = false; //办理离职
				this.DialogModal8 = false; //更换岗位
				this.DialogModal9 = false; //恢复可用
				this.DialogModal10 = false; //不可用
				this.item = item
			},
			async handleClickSuccessPhysical() {
				// 发请求
				let url = this.ServicesApi.peThrough;
				let data = {
					pe_id: this.item.pe_id,
					remark: this.remark5,
				};
				if (!this.canSubmit) return;
				this.canSubmit = false;
				let result = await this.Services.post(url, data);
				this.canSubmit = true;
				if (result.code == this.StatusCode.SUCCESS_CODE) {
					this.modalName = null
					// this.$parent.getcountTopList();
					this.onRefresh && this.onRefresh();
					uni.showToast({
						icon: 'none',
				        title: result.msg
					});
				}
			},
			// 确认入职
			affirmEntry(item) {
				if (item.status == 3) {
					uni.showToast({
						icon: 'none',
						title: '该员工已入职其他职位，无法入职',
					});
					return;
				}
				uni.navigateTo({
					url: '/pages/work_bench/confirm_entry?item=' + JSON.stringify(item)
				});
			},
			// 放弃入职
			giveupEntry(item, name) {
				this.modalName = name
				this.DialogModal = false;
				this.DialogModal1 = false; // 取消候选
				this.DialogModal2 = false; //面试不通过
				this.DialogModal3 = false; //进入体检
				this.DialogModal4 = false; //体检不成功
				this.DialogModal5 = false; //进入待入职
				this.DialogModal6 = true; //放弃入职
				this.DialogModal7 = false; //办理离职
				this.DialogModal8 = false; //更换岗位
				this.DialogModal9 = false; //恢复可用
				this.DialogModal10 = false; //不可用
				this.item = item
			},
			async handleClickGiveupEntry() {
				// 发请求
				let url = this.ServicesApi.prepareCancel;
				let data = {
					jlog_id: this.item.jlog_id, //人才库-待入职中的返回值
					personnel_id: this.item.id, //人才库-待入职中的返回值
				};
				if (!this.canSubmit) return;
				this.canSubmit = false;
				let result = await this.Services.post(url, data);
				this.canSubmit = true;
				if (result.code == this.StatusCode.SUCCESS_CODE) {
					this.modalName = null
					// this.$parent.getcountTopList();
					this.onRefresh && this.onRefresh();
					uni.showToast({
						icon: 'none',
				        title: result.msg
					});
				}
			},
			// 离职
			manageLeave(item, name) {
				this.getPost();
				this.modalName = name
				this.DialogModal = false;
				this.DialogModal1 = false; // 取消候选
				this.DialogModal2 = false; //面试不通过
				this.DialogModal3 = false; //进入体检
				this.DialogModal4 = false; //体检不成功
				this.DialogModal5 = false; //进入待入职
				this.DialogModal6 = false; //放弃入职
				this.DialogModal7 = true; //办理离职
				this.DialogModal8 = false; //更换岗位
				this.DialogModal9 = false; //恢复可用
				this.DialogModal10 = false; //不可用
				this.item = item
			},
			async handleClickManageLeave() {
				// 发请求
				let url = this.ServicesApi.leaveCompany;
				let data = {
					jlog_id: this.item.jlog_id, //人才库-在职中的返回值
					personnel_id: this.item.id, //人才库-在职中的返回值
					leave_style: this.leaveCase, //离职类型
					clear_money_time: this.date1, //薪资结清日
					leave_time: this.date, //离职时间
					remark: this.remark6
				};
				if (!this.canSubmit) return;
				this.canSubmit = false;
				let result = await this.Services.post(url, data);
				this.canSubmit = true;
				if (result.code == this.StatusCode.SUCCESS_CODE) {
					this.modalName = null
					// this.$parent.getcountTopList();
					this.onRefresh && this.onRefresh();
				}
				uni.showToast({
					icon: 'none',
					title: result.msg
				});
			},
			// 调换岗位
			changePost(item, name) {
				this.getPost();
				this.modalName = name
				this.DialogModal = false;
				this.DialogModal1 = false; // 取消候选
				this.DialogModal2 = false; //面试不通过
				this.DialogModal3 = false; //进入体检
				this.DialogModal4 = false; //体检不成功
				this.DialogModal5 = false; //进入待入职
				this.DialogModal6 = false; //放弃入职
				this.DialogModal7 = false; //办理离职
				this.DialogModal8 = true; //更换岗位
				this.DialogModal9 = false; //恢复可用
				this.DialogModal10 = false; //不可用
				this.item = item
			},
			async handleClickChangePost() {
				// 发请求
				let url = this.ServicesApi.changePosition;
				let data = {
					position_id: this.position_id, //新选岗位
					position_id_old: this.item.position_id, //原岗位
					jlog_id: this.item.jlog_id, //入职离职记录表id
				};
				if (!this.canSubmit) return;
				this.canSubmit = false;
				let result = await this.Services.post(url, data);
				this.canSubmit = true;
				if (result.code == this.StatusCode.SUCCESS_CODE) {
					this.modalName = null
					// this.$parent.getcountTopList();
					this.onRefresh && this.onRefresh();
					uni.showToast({
						icon: 'none',
				        title: result.msg
					});
				}
			},
			// 恢复可用
			recoverUse(item, name) {
				// console.log("调用了")
				this.getPost();
				this.modalName = name
				this.DialogModal = false;
				this.DialogModal1 = false; // 取消候选
				this.DialogModal2 = false; //面试不通过
				this.DialogModal3 = false; //进入体检
				this.DialogModal4 = false; //体检不成功
				this.DialogModal5 = false; //进入待入职
				this.DialogModal6 = false; //放弃入职
				this.DialogModal7 = false; //办理离职
				this.DialogModal8 = false; //更换岗位
				this.DialogModal9 = true; //恢复可用
				this.DialogModal10 = false; //不可用
				this.item = item
			},
			async handleClickRecoverUse() {
				// 发请求
				let url = this.ServicesApi.recovery;
				let data = {
					id: this.item.id, //人才库-不可用列表中人才的id
				};
				if (!this.canSubmit) return;
				this.canSubmit = false;
				let result = await this.Services.post(url, data);
				this.canSubmit = true;
				if (result.code == this.StatusCode.SUCCESS_CODE) {
					this.modalName = null
					// this.$parent.getcountTopList();
					this.onRefresh && this.onRefresh();
					uni.showToast({
						icon: 'none',
				        title: result.msg
					});
				}

			},
			// 不可用
			disabled(item, name) {
				this.getPost();
				this.modalName = name
				this.DialogModal = false;
				this.DialogModal1 = false; // 取消候选
				this.DialogModal2 = false; //面试不通过
				this.DialogModal3 = false; //进入体检
				this.DialogModal4 = false; //体检不成功
				this.DialogModal5 = false; //进入待入职
				this.DialogModal6 = false; //放弃入职
				this.DialogModal7 = false; //办理离职
				this.DialogModal8 = false; //更换岗位
				this.DialogModal9 = false; //恢复可用
				this.DialogModal10 = true; //不可用
				this.item = item
			},
			async handleClickDisabled() {
				// 发请求
				let url = this.ServicesApi.del;
				let data = {
					id: this.item.id, //人才库-不可用列表中人才的id
				};
				if (!this.canSubmit) return;
				this.canSubmit = false;
				let result = await this.Services.post(url, data);
				this.canSubmit = true;
				if (result.code == this.StatusCode.SUCCESS_CODE) {
					// console.log(res.data);
					this.dataSource = [];
					this.modalName = null
					// this.$parent.getcountTopList();
					if (this.tabnum == 0) {
						this.onRefresh && this.onRefresh();
					} else if (this.tabnum == 7) {
						this.onRefresh && this.onRefresh();
					}
					uni.showToast({
						icon: 'none',
				        title: result.msg
					});
				} else {

					uni.showToast({
						icon: 'none',
				        title: result.msg
					});
				}

			},
			//取消
			hideModal(e) {
				this.modalName = null;
				// uni.showToast({
				// 	title: "取消成功"
				// });
			},


			onPressToNavigateDetail(item) {
				// console.log(item.id);
				const id = item.id
				uni.navigateTo({
					url: '/pages/talent_pool/talent_detail?id=' + id,
				});
			}
		},
		mounted() {
			console.log("this.tabnum------>>",this.tabnum)
		}
	}
</script>

<style scoped lang="stylus">
	.post-txt {
		font-size: 24upx;
		color: #666666;
		background: #F3F3F3;
		// margin:4upx 0upx;
		// width:0;
		text-align: center;
	}

	.leavemsg {
		height: 30upx;
		font-size: 28upx;
		margin-bottom: 20upx;
		color: red;
	}

	// 放弃入职模态框样式
	.top-title {
		font-size: 28upx;
		font-weight: 400;
		margin-left: 30rpx;
		color: rgba(255, 255, 255, 1);
	}

	.set-width {
		width: 540upx;
	}

	.set-padding {
		padding: 30upx 28upx 30upx 30upx;
	}

	.changebgc {
		background: #4A90E2;
		height: 70upx !important;
	}

	.flex-mine {
		align-items: center;
	}

	.title-h2 {
		font-size: 30upx;
		color: #666;
	}

	.detail-h2 {
		text-align: left;
		font-size: 30upx;
		color: #333;
		font-weight: 400;
	}

	.inp-model {
		height: 60upx;
		width: 318upx;
		background: #F3F3F3;
		line-height: 60upx;
		justify-content: space-between;
		padding: 0 26upx;
		font-size: 30upx;
		color: #333;
	}

	.set-bottom {
		height: 92upx;
		line-height: 92upx;
	}

	.set-btn1 {
		height: 92upx;
		line-height: 92upx;
		background: #fff;
		border-right: 1px solid #D8D8D8;
		border-top: 1px solid #D8D8D8;
		width: 270upx;
		font-size: 30upx;
		text-align: center;
		color: #333;
	}

	.set-btn2 {
		height: 92upx;
		line-height: 92upx;
		background: #fff;
		width: 268upx;
		border-top: 1px solid #D8D8D8;
		font-size: 30upx;
		text-align: center;
		color: #4A90E2;
	}

	// 
	.source {
		margin: 20rpx 0;

		.source-title {
			font-size: 28upx;
			font-weight: 400;
			color: rgba(153, 153, 153, 1);
		}

		.source-detail {
			font-size: 28upx;
			font-weight: 400;
			margin-left: 24upx;
			color: rgba(51, 51, 51, 1);
		}
	}

	.talent-list-item {
		padding: 20rpx 0;
		margin-bottom: 20rpx;
		background-color: #FFFFFF;

	}

	.talent-name {
		font-size: 36upx;
		color: #333333;
		margin-right: 20upx;
	}

	.set-height {
		padding: 38rpx;
		min-height: 180rpx;
	}

	.talent-profile-info {
		margin: 10upx 0 20upx;
	}

	.detail-item {
		color: #666666;
		font-size: 28upx;
		margin-right: 20upx;
	}

	.detail-item-cur {
		color: #333333;
	}

	.detail-right-con {
		width: 40upx;
		height: 40upx;
		margin-left: 10upx;
	}

	.horizontal-line {
		margin: 10rpx 0 20rpx;
	}

	.bottom-left-con {
		color: #666666;
		font-size: 26rpx;
	}

	.btn-wrap {
		margin-left: 20rpx;
	}

	.btn-item {
		border: none;
		margin-left: 20rpx;
	}

	.btn-item .btn-icon {
		width: 30rpx;
		height: 30rpx;
		margin-right 10rpx;
	}

	.btn-item .btn-title {
		margin-top: 0;
	}

	.recommend-btn-item .btn-icon {
		// margin-top: 0;
		// margin-right: 10upx;
	}

	.vertical-line {
		height: 40rpx;
	}

	.set-bottom {
		height: 92upx;
		line-height: 92upx;
	}

	.set-width {
		width: 540upx;
	}

	.set-btn1 {
		height: 92upx;
		line-height: 92upx;
		background: #fff;
		border-right: 1px solid #D8D8D8;
		border-top: 1px solid #D8D8D8;
		width: 270upx;
		font-size: 30upx;
		text-align: center;
		color: #333;
	}

	.set-btn2 {
		height: 92upx;
		line-height: 92upx;
		background: #fff;
		width: 268upx;
		border-top: 1px solid #D8D8D8;
		font-size: 30upx;
		text-align: center;
		color: #4A90E2;
	}

	.text-area-view {
		flex: 1;
		padding: 18rpx;
		background: #F3F3F3;
	}

	.set-textarea {
		margin: 0;
		padding: 10rpx;
		height: 160upx;
		text-align: left;
	}

	.btn-title {
		margin-top: 10upx;
	}

	.one-title {
		margin-left: 6upx;
	}

	.bottom-content {
		.btn-wrap {
			min-width: 460rpx;
		}
	}
</style>
